<template>
  <div>
    <RouterView />
    <van-tabbar v-model="active" router>
      <van-tabbar-item icon="home-o" to="/home">首页</van-tabbar-item>
      <div class="circle">
        <van-icon name="plus" color="#fff" size="40" class="plus" @click="router.push('/a')" />
      </div>
      <van-tabbar-item icon="setting-o" to="/my">我的</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { RouterView } from 'vue-router'
import { useRouter } from 'vue-router'
const router = useRouter()

const active = ref(0)
</script>

<style scoped>
.circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: rgb(25, 137, 250);
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
}

.plus {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
</style>
